﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using KPIS.GERP.GIMS.MODEL;
using KPIS.GERP.GIMS.IBLL;
using KPIS.GERP.GIMS.IDAL;
using KPIS.GERP.GIMS.DALFactory;

namespace KPIS.GERP.GIMS.BLL
{
    public class MasterContactBLL : IBLLMasterContact
    {
        private static readonly IDALMasterContact dal = DataAccess.CreateMasterContact();

        public MasterContactBLL()
        {

        }

        public IList<MasterContactInfo> GetMasterContact()
        {
            return dal.GetMasterContact();
        }

        public IList<MasterContactInfo> GetMasterContact(string record_status)
        {
            return dal.GetMasterContact(record_status);
        }

        public MasterContactInfo GetMasterContact(int seq)
        {
            return dal.GetMasterContact(seq);
        }

        public void Insert(MasterContactInfo info)
        {
            try
            {
                dal.Insert(info);
            }
            catch
            {
                throw;
            }
        }

        public void Insert(MasterContactInfo info, IList<MasterContactBankInfo> infoListBank, IList<MasterContactPartnerInfo> infoListPartner)
        {
            try
            {
                dal.Insert(info, infoListBank, infoListPartner);
            }
            catch
            {
                throw;
            }
        }

        public void Update(MasterContactInfo info)
        {
            try
            {
                dal.Update(info);
            }
            catch
            {
                throw;
            }
        }

        public void Delete(MasterContactInfo info)
        {
            try
            {
                dal.Delete(info);
            }
            catch
            {
                throw;
            }
        }

        public void DeleteAll(IList<MasterContactInfo> infoList)
        {
            try
            {
                dal.DeleteAll(infoList);
            }
            catch
            {
                throw;
            }
        }

        public void DeleteFromDB(IList<MasterContactInfo> infoList)
        {
            try
            {
                dal.DeleteFromDB(infoList);
            }
            catch
            {
                throw;
            }
        }

        public void Restore(IList<MasterContactInfo> infoList)
        {
            try
            {
                dal.Restore(infoList);
            }
            catch
            {
                throw;
            }
        }

        public IList<MasterContactInfo> GetMasterContactNoBlackList(string search_text)
        {
            return dal.GetMasterContactNoBlackList(search_text);
        }

        public MasterContactInfo GetContactByPo(int PoSeq)
        {
            return dal.GetContactByPo(PoSeq);
        }
    }
}
